import Vue from 'vue'
import uView from "uview-ui"
import store from './store'
import './components/'
import api from './api/'
import {
	addBaseURL
} from './utils/common.js'
import App from './App'
Vue.prototype.$addBaseURL = addBaseURL
Vue.prototype.$store = store
Vue.prototype.$api = api
Vue.prototype.$volume = 6000;
Vue.prototype.$state = (state) => {
	if (state === 0) return '揽收'
	if (state === 1) return '发出'
	if (state === 2) return '到达'
	if (state === 3) return '待取件'
	if (state === 4) return '问题件'
	if (state === 5) return '签收'
}

Vue.config.productionTip = false
Vue.use(uView)

let token = uni.getStorageSync('token')
let isLao = uni.getStorageSync('isLao')
let username = uni.getStorageSync('username')
let devId = uni.getStorageSync('devId')

store.dispatch('setToken', token)
store.dispatch('setIsLao', isLao)
store.dispatch('setUsername', username)
store.dispatch('setDevId', devId)

App.mpType = 'app'

const app = new Vue({
	...App
})
app.$mount()
